package homegroup.inc.dao;

import homegroup.inc.dto.Comment;

import javax.ejb.Stateless;

@Stateless
public class CommentDAO extends BaseDAO {
    private Comment comment = null;

    public void create(Comment comment) {
        entityManager.persist(comment);
    }

    public Comment findById(int id) {
        comment = entityManager.find(Comment.class, id);
        return comment;
    }

    public void update(Comment comment) {
        entityManager.merge(comment);
    }

    public void delete(Comment comment) {
        entityManager.remove(comment);
    }
}
